package com.bkq.cb;
import com.bkq.cb.BLO.ReturnDayReport;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.*;
public class Report extends Activity {
	private Button back;
	ReturnDayReport  rp =new ReturnDayReport(this); 
	private TextView today,moneyIn,moneyEx,moneyBaTra,moneyLo,moneyDe,moneyBaLo;
	String idUser,nameUser,value;
	public void onCreate(Bundle savedInstanceState) {
		 super.onCreate(savedInstanceState);
	     setContentView(R.layout.report);
	     today = (TextView)findViewById(R.id.today_report);
	     back = (Button)findViewById(R.id.backIma_Report);
	     moneyIn = (TextView)findViewById(R.id.moneyIn_DayReport);
	     moneyEx = (TextView)findViewById(R.id.moneyEx_DayReport);
	     moneyBaTra = (TextView)findViewById(R.id.moneyBanTran_DayReport);
	     moneyLo = (TextView)findViewById(R.id.moneyLo_DayReport);
	    
	     moneyDe = (TextView)findViewById(R.id.moneyDe_DayReport);
	     moneyBaLo = (TextView)findViewById(R.id.moneyBanLoan_DayReport);
	    
	     Bundle extras = getIntent().getExtras();
         if(extras!=null)
	     {
	    idUser = extras.getString("idUser").toString();
	    nameUser = extras.getString("nameUser").toString();
	    value = extras.getString("today").toString();
	     }
         back.setOnClickListener(new View.OnClickListener() {
 			
 			@Override
 			public void onClick(View v) {
 				// TODO Auto-generated method stub
 				Intent i = new Intent(Report.this,SelectModeReport.class);
 				i.putExtra("idUser", idUser);
				i.putExtra("nameUser", nameUser);
				startActivity(i);
 			}
 		});
         today.setText(value);
         float [] s = new float[6];
         s = rp.getValue(value, idUser);
         moneyIn.setText(String.valueOf(s[0]));
         moneyEx.setText(String.valueOf(s[1]));
         moneyBaTra.setText(String.valueOf(s[2]));
         moneyLo.setText(String.valueOf(s[3]));
         moneyDe.setText(String.valueOf(s[4]));
         moneyBaLo.setText(String.valueOf(s[5]));
	}
}
